home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / rtgmaster_dev / goodies / asmconv / example.asm < prev   
Assembly Source File  |  1996-12-08  |  4KB  |  266 lines

  1.  
  2. .data
  3.  
  4. constant1 = 10+20
  5. constant2 = 20
  6. constant3 = 30
  7.  
  8. Index dw 0
  9. Segment dd 0
  10. Long dd 0
  11. Byte db 0
  12.  
  13.  
  14. Label1 db 100+6*constant1
  15. Label2    dw 290,3249,4328
  16.  db constant1 dup (constant2)
  17.  dd 10,0
  18.  db 'string',"string"
  19.  even
  20.  
  21. Label3 db 0
  22.  even
  23.  dw Label3
  24.  even
  25.  
  26.  ;hex- values:
  27.  dw 0ab01h,10h,0abh,0ffh,0ffh
  28.  
  29. ENDS
  30.  
  31. .code
  32.  
  33. Label:
  34.  
  35.  
  36.  
  37. ;mov-command ----------------------
  38.  
  39.  mov ax,[ds:si]
  40.  
  41.  mov ax,10[ds:si]
  42.  
  43.  mov [es:di],ax
  44.  
  45.  mov Label3,BYTE PTR[constant1[ds:si+bx]]
  46.                ; mov Label3,BYTE PTR[constant1[ds:si+bx]]
  47.  
  48.  mov al,constant2+10[es:bx]  ; mov al,constant2+10[es:bx]
  49.  
  50.  mov al,constant3[es:si]   ; mov al,constant3[es:si]
  51.  
  52.  mov Long,0    ;mov Long,0
  53.  
  54.  mov ax,0       ;mov ax,0
  55.  
  56.  mov bl,0       ;mov bl,0
  57.  
  58.  mov eax,-100   ;mov eax,-100
  59.  
  60.  mov eax,300    ;mov eax,300
  61.  
  62.  mov ax,10      ;mov ax,10
  63.  
  64.  mov di,si      ;mov di,si
  65.  
  66.  mov ah,0     ;mov ah,0
  67.  
  68.  mov bh,0       ;mov bh,0
  69.  
  70.  mov ax,bx      ;mov ax,bx
  71.  
  72.  mov al,bl      ;mov al,bl
  73.  
  74.  mov ah,bh      ;mov ah,bh
  75.  
  76.  mov ah,5       ;mov ah,5
  77.  
  78.  mov si,ax    ;mov si,ax
  79.  
  80.  mov ax,si      ;mov ax,si
  81.  
  82.  mov Label,5    ;mov Label,5
  83.  
  84.  lea bx,Label   ;lea bx,Label
  85.  
  86. ; xchg-command ----------------------
  87.  xchg ax,bx    ;xchg ax,bx
  88.  
  89.  xchg Long,eax  ;xchg Long,eax
  90.  
  91.  xchg al,bh    ;xchg al,bh
  92.  
  93.  xchg ah,bh     ;xchg ah,bh
  94.  
  95. ;add: -------------------------
  96.  
  97.  add di,ax    ;add di,ax
  98.  
  99.  add ax,bx    ;add ax,bx
  100.  
  101.  add dh,10    ;add dh,10
  102.  
  103.  add bh,ch    ;add bh,dh
  104.  
  105.  add Label2,ah ;add Label2,ah
  106.  
  107.  add ax,si     ;add ax,si
  108.  
  109.  add si,ax     ;add si,ax
  110.  
  111.  add si,1      ;add si,1
  112.  
  113.  and si,ax     ;and si,ax
  114.  
  115.  
  116. ;inc,dec
  117.  inc ax        ;inc ax
  118.  
  119.  inc bh        ;inc bh
  120.  
  121.  dec Label2    ;dec Label2
  122.  
  123. ;cmp
  124.  cmp ah,bh     ;cmp ah,bh
  125.  
  126.  cmp ah,10     ;cmp ah,10
  127.  
  128.  cmp bl,ah     ;cmp bl,ah
  129.  
  130.  cmp Label2,10 ;cmp Label2,10
  131.  
  132.  cmp si,ax     ;cmp si,ax
  133.  
  134.  cmp ax,si     ;cmp ax,si
  135.  
  136.  cmp si,0      ;cmp si,0
  137.  
  138.  cmp ax,10     ;cmp ax,10
  139.  
  140.  cmp Long,0    ;cmp Long,0
  141.  
  142.  cmp ax,0      ;cmp ax,0
  143.  
  144.  cmp si,di     ;cmp si,di
  145.  
  146. ;not:
  147.  not ax           ;not ax
  148.  
  149.  not ah           ;not ah
  150.  
  151.  not si        ;not si
  152.  
  153.  not Long      ;not Long
  154.  
  155. ;neg:
  156.  neg ax           ;neg ax
  157.  
  158.  neg ah           ;neg ah
  159.  
  160.  neg si        ;neg si
  161.  
  162.  neg Long      ;neg Long
  163.  
  164.  
  165.  
  166.  
  167. ;sonstige:
  168.  mov cx,10     ;mov cx,10
  169. myloop:
  170.  loop myloop ;loop Schleife
  171.  clc           ;clc
  172.  stc           ;stc
  173.  jc myloop   ;jc Schleife
  174.  jnc myloop  ;jnc Schleife
  175.  
  176. ;stack-commands:
  177.  push ax       ;push ax
  178.  pop ax        ;pop ax
  179.  
  180.  push si       ;push si
  181.  pop  si       ;pop si
  182.  
  183. ;string-commands:
  184.  lodsb         ;lodsb
  185.  lodsw         ;lodsw
  186.  lodsd         ;lodsd
  187.  
  188.  stosb         ;stosb
  189.  stosw         ;stosw
  190.  stosd         ;stosd
  191.  
  192.  movsb         ;movsb
  193.  movsw         ;movsw
  194.  movsd         ;movsd
  195.  
  196.  cmpsb           ;cmpsb
  197.  cmpsw         ;cmpsw
  198.  cmpsd         ;cmpsd
  199.  
  200. ;mul:
  201.  mul bx           ;mul bx
  202.  
  203.  mul bh        ;mul bh
  204.  
  205.  imul bl       ;imul bl
  206.  
  207.  mul ax,bx     ;mul ax,bx
  208.  
  209. ;div:
  210.  
  211.  div bx           ;div bx
  212.  
  213.  div bh        ;div bh
  214.  
  215.  idiv bl       ;idiv bl
  216.  
  217. ;lea test
  218.  
  219.  lea si,Index          ;lea si,Index
  220.  
  221.  lea bx,Index          ;lea bx,Index
  222.  
  223. ;les test
  224.  
  225.  les si,DWORD PTR[Index]  ; les si,DWORD PTR[Index]
  226.  
  227.  lgs si,DWORD PTR[Index]  ; lgs si,DWORD PTR[Index]
  228.  
  229.  
  230. ;locale labels in  procedure test
  231.  
  232. procedure1 proc
  233.  mov ax,0
  234.  
  235. @@1:             ; locale Label in procedure1
  236.  
  237. @@2:             ;   "      "    "   "
  238. procedure2 proc
  239.  mov ax,1
  240. @@1:             ;   "      "    " procedure2
  241. procedure3 proc
  242.  mov ax,2
  243. @@1:         ;   "      "    " procedure3
  244.  
  245. endp
  246.  
  247. @@2:
  248. endp
  249.  
  250. endp
  251.  
  252. ;macro test
  253.  MyMakro1 10,bx,constant1+3         ;MyMakro1 10,bx,constant1+3
  254.  MyMakro2 10,bx,constant2+3,3,Label ;MyMakro2 10,bx,constant2+3,3,Label
  255.  
  256. ;jump test
  257.  call procedure1  ;call procedure1
  258.  call SetImage   ;call SetImage
  259.  jcxz procedure1     ;jcxz procedure
  260.  jecxz procedure1    ;jecxz procedure
  261.  je procedure1        ;je procedure1
  262.  
  263. ENDS
  264. END
  265.  
  266.